#include "dialogcadpocoimpl.h"
#include "loginUi.h"

extern loginUi *login;
//
dialogCadPocoImpl::dialogCadPocoImpl( QWidget * parent, Qt::WFlags f) 
	: QDialog(parent, f)
{
	setupUi(this);
	connect(pb_ok,SIGNAL(clicked()),SLOT(requestRegisterWell()));
}

void dialogCadPocoImpl::showEvent ( QShowEvent *) {
	cb_mestre->clear();
	std::map<int,simuladores>::iterator begin = login->win.sMap.begin();
	for(; begin != login->win.sMap.end(); begin++) {
		cb_mestre->addItem(begin->second.name);
	}	
}
void dialogCadPocoImpl::requestRegisterWell() {
	login->win.registerWellRequest(le_name->text(),le_Id->text().toInt(),cb_mestre->currentIndex());
}
//

